<div id="footer"><div id="wrapFooter">
<p id="copyright">Copyright &copy; by EncoreAdmin. All rights reserved.</p>
<p id="author">Created by: <a href="#">MultimediaDesign</a>. Icons: <a href="http://p.yusukekamiyamane.com">Fugue Icons</a>, <a href="http://wefunction.com/2008/07/function-free-icon-set">Function Icon Set</a></p>
</div>
</div>
<div id="mcategory" style="width:500px; min-height:200px; height:auto; _height:200px; position:absolute; border:solid 5px #666; display:none; left:350px; top:200px; background:#ccc;">
    <div id="close" style="text-align:right; background:#666;"><a href="#" onclick="closeCategory()" style="color:#fff;">CLOSE</a></div>
    <div id="category-content"></div>
</div>

<div id="reply" style="width:300px; height:150px; padding:0 3px; position:absolute; background:#ccc; left:350px; top:200px; display:none;">
       回复内容:<br />       
          <textarea id="body" rows="6" cols="43"></textarea>
          <input type="hidden" value="" id="id" name="id" />
          <input type="hidden" value="" id="pid" name="pid" />
          <input type="button" value="reply" onclick="replyajax()">  <input type="button" value="close" onclick="closereply()" />
       
</div>
<script>

function addimg(){
	
	 str= '<div class="field clear">';
	 str+= '<label for="fileUpload">Image upload:</label>';
	 str+= '<input type="file" name="pic[]" class="upload" id="fileUpload">';
	 str+= '</div>';
	 str+= '<div class="field clear">';
	 str+= '<label for="areaText">Image description: <span class="star">*</span></label>';
	 str+= '<textarea name="des[]" cols="30" rows="5" class="area longest" id="areaText"></textarea>';
	 str+= '<a href="#" class="hint"> <img class="hint" alt="Hint" src="../_i/ico/icohint.png">';
	 str+= '<span>Lorem ipsum dolor sit amet, consectetur adipiscing elit. Fusce eu urna nisi, ut fringilla justo.</span></a>';
	 str+= '<p class="error clear"></p>';
	 str+= '</div>';
	 
	  $("#pic").append(str);
	}

function replyajax()
{
    body = $("#body").val();
    id = $("#id").val();
    pid = $("#pid").val();
	$.post("<?php echo base_url('comment/reply');?>",{"body":body,"id":id,"pid":pid},function(){ history.go(0);});
	closereply();
}

/*
 *  id 当前文章的ID
  *  cid 回复当前评论的ID 
 *
 */
function replycomment(id,cid,tid)
	{
        $("#id").val(id);
	    $("#pid").val(cid);
	    content = "<?php echo "L";?>回复";
	    v = $(tid).parent('td').parent('tr').find(".colPosition").html();
	    $("#body").val(content+"@"+v+" ");
		showreply();
	}

function showreply()
{
	$("#reply").css("display", "block");
}

function closereply()
{
	$("#reply").css("display", "none");
}

/* 文章分类 javascript ajax 部分*/
function showCategory()
{
    //alert(0);
    ajaxCategory();
	$("#mcategory").css('display',"block");
}

function closeCategory()
{
	$("#mcategory").css('display',"none");
}

function ajaxCategory()
{
	$.ajax({
		type:"post",
		url:"/category/index",
		success:function(data){
		
                $("#category-content").html(data);
	    }
		});
}

function ajaxEditCategory(id)
{
	$.ajax({
		type:"post",
		url:'/category/edit/',
		data:"id="+id,
		success:function(data){
                 dataobj = eval("("+data+")");
                 //alert(dataobj.cid);
                 $("#zh_name").val(dataobj.name);
                 $("#en_name").val(dataobj.ename);
                 $("#action").click(function(){
                     $.ajax({
                          type:"post",
                          url:"/category/update",
                          data:"cid="+id+"&name="+$("#zh_name").val()+"&ename="+$("#en_name").val(),
                          success:function(data){
                               alert(data);
                               ajaxCategory();
                          }
                         });
                     });
	    }
		});
}

/*      文章列表操作                   */

function checkall()
{
    is = $('#cbSelectAll').attr('checked');
    if(is){
	         $('#articlelist').find('input').attr('checked', true);
    }else{
    	     $('#articlelist').find('input').attr('checked', false);
    }
    
}

function doit(id,action)
{
	val = id.value;
	//alert(val);
	if(val == 'delete')
	{
		$('#form1').attr('action','/'+action+'/batchdrop');
		$('#form1').submit();
	}
	if(val == 'deactivate')
	{
		$('#form1').attr('action','/'+action+'/batchdeactivate');
		$('#form1').submit();
	}
	if(val == 'activate')
	{
		$('#form1').attr('action','/'+action+'/batchactivate');
		$('#form1').submit();
	}
}


/*    评论部分                */


</script>
</body>
</html>